package com.asteros.crypto.utils.services;

import java.io.FileInputStream;
import com.asteros.common.util.io.IOUtil;

public final class CRLService {
//	private static final CRLService instance = new CRLService();

	private CRLServiceConfig config = null;

/*	public static CRLService getInstance() {
		return instance;
	}
*/	
	public CRLService(CRLServiceConfig serviceConfig)	throws Exception
	{
		setConfig(serviceConfig);
	}
	public void setConfig(CRLServiceConfig config) {
		this.config = config;
		System.out.println("CRLServiceConfig.setConfig.url=" + config.getFileName());
	}
	
	public byte[] getCRL() throws Exception{
		FileInputStream in = new FileInputStream(config.getFileName());
		return IOUtil.readFully(in);
	}
}
